/**
 * Copyright (c) 2006 RiseSoft Co.,Ltd  
 * $Header$
 */
package cn.newtest.bi.collection.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * 指标分类
 *
 * @author <a href="mailto: guanfeng@risesoft.net">关锋</a>
 * @version $Revision$
 * 
 */
@Entity
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name="Rpt_IndicationType")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class IndicationType implements Comparable<Object>, Serializable {
	
	private static final long serialVersionUID = -8003531206423675367L;

	@Id
	@Column(name="IndicationType_guid",length=38)
	@GenericGenerator(name="IndicationType-assigned",strategy="assigned")
	private String guid;
	
	@Column(name="IndicationType_name",length=64)
	private String name;
	
	@Column(name="IndicationType_code",length=64)
	private String code;
	
	@Basic
	private Double tabIndex;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getTabIndex() {
		return tabIndex;
	}

	public void setTabIndex(Double tabIndex) {
		this.tabIndex = tabIndex;
	}

	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		IndicationType myClass = (IndicationType) object;
		return new CompareToBuilder().append(this.code, myClass.code).append(this.tabIndex, myClass.tabIndex).append(this.guid, myClass.guid).append(this.name, myClass.name).toComparison();
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof IndicationType)) {
			return false;
		}
		IndicationType rhs = (IndicationType) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(this.code, rhs.code).append(this.tabIndex, rhs.tabIndex).append(this.guid, rhs.guid).append(this.name, rhs.name).isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(2130679225, -1089162969).appendSuper(super.hashCode()).append(this.code).append(this.tabIndex).append(this.guid).append(this.name).toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("tabindex", this.tabIndex).append("name", this.name).append("code", this.code).append("guid", this.guid).toString();
	}

}